﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;
using System.Resources;

namespace IDE_week2_Forms_project
{
    

    public partial class Form1 : Form
    {

        int c = 0;
        public Form1()
        {
          //  Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
            
            InitializeComponent();
        }
        

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void onf_Click(object sender, EventArgs e)
        {
            Form2 obj = new Form2();
            obj.Icon = Properties.Resources.Icon2;
            obj.Show();
           
        }

        private void change_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.Icon1;

        }
        // cant reset the icon
        private void reset_Click(object sender, EventArgs e)
        {
            Form obj = new Form();
            this.Icon = obj.Icon;
        }

        private void language_Click(object sender, EventArgs e)
        {
            /*int a = 0, b = 0;
            if (c == 0) a = 1;
            else b = 0;
            if (a == 1)
            {
                ChangeLanguage("fr-FR");
                b = 1;
                c = 1;
            }

            if (b == 0)
            {
                ChangeLanguage("en");
                c = 0;
            }
            */
            ChangeLanguage("en");

        }

            private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo("fr-FR"));
            }
        }

            private void button5_Click(object sender, EventArgs e)
            {
                int[] numbers = new int[10];
                Class1.MakeRandomNumber(numbers);
                label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

            }
        
        }
    }

